package edu.java.texbooks.tutorial.test02;

public class Student implements Relatable{
    
    // --- Instance Variables --------------------------------------------------
    private int weight=0;
 
    // --- Constructors --------------------------------------------------------
    public Student() {
	this(0);
    }
    
    public Student(int weight) {
	this.weight = weight;
    }

    
    // --- Getters and Setters -------------------------------------------------
    public int getWeight() {
        return weight;
    }

    public void setWeight(int weight) {
        this.weight = weight;
    }
    
    // --- Override Methods ----------------------------------------------------
    @Override
    public int isLargerThan(Relatable object){
	Student stud=(Student)object;
	if(this.getWeight()>stud.getWeight()){
	    return 1;
	}else if(this.getWeight()<stud.getWeight()){
	    return -1;
	}else{
	    return 0;
	}
    }

}
